Compare commits

...

21 Commits
3.8.2 ... 3.8.3

Author SHA1 Message Date
Uwe Kindler
89ff0ad311 Added PRE Workbench to Showcase section 2022-07-29 13:57:08 +02:00
Uwe Kindler
6caeac2cb4 Merge branch 'master' of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System 2022-07-29 13:26:23 +02:00
Uwe Kindler
a0f0640c9f Fixed CustomCloseHandling for floating widgets 2022-07-29 13:25:14 +02:00
Mira Weller
d3f5879119 upgrade PyQt build (#404)
* Add new flags from 3.7 and 3.8

* remove unnecessarily deep namespace for Python module

* Update PyQt5 bindings build to new build system

* fix opening tabbed dockWidgets

* fix RESOURCES configuration for sip build

* increment build version

* remove leftovers

* add file names explicitly

* Update pyproject.toml
2022-07-19 13:17:45 +02:00
bjb-work
df74686287 call CDockWidget::closeDockWidgetInternal when close attempt and CustomCloseHandling (#438)
Co-authored-by: bjb-work <N/A>
2022-07-15 14:47:20 +02:00
Uwe Kindler
75d58b3ea3 Fixed #433 - Link issue of debug library with MSVC19 2022-07-04 07:41:26 +02:00
Uwe Kindler
bedd25021c Fixed issue #429 - Raise floating widget on toggleView() request 2022-06-17 08:31:24 +02:00
Uwe Kindler
0e566cb8a3 Fixed #420 - Floating docks title doesn't update
added tests for DockWidget->setWindowTitle() in demo application
2022-05-10 13:41:19 +02:00
Mira Weller
23f80334f6 Fix issue #415 (#416) 2022-05-03 08:47:31 +02:00
Uwe Kindler
7063909cee Added MetGem to showcase section 2022-04-21 16:29:55 +02:00
Igor Sirotin
a284e3bd65 CMake bugfixes [target alias, license install] (#412)
* Added alias to cmake library target

* Fixed CMake license install

Co-authored-by: Igor Sirotin <i.sirotin@1440.space>
2022-04-18 23:07:48 +02:00
ARSanderson
823887daf8 Tidy/doc updates (#410)
* minor updates to clarify when the dock manager should be created

* fixed typos
2022-04-12 07:58:18 +02:00
Uwe Kindler
78a4166e42 Updated CFloatingDockContainer::closeEvent() function to delete all dock widgets with DockWidgetDeleteOnClose flag set 2022-03-25 13:31:40 +01:00
tytan652
3d3b694040 Avoid calling XCB functions under non-XCB Linux platform (#405) 2022-03-24 19:43:39 +01:00
ruffianhy
ad06241c9d fix(issue-350): on RedHat/CentOS, sometimes there will be one more move event after user release their mouse which will cause the floating overlay can not be hide. Here we use the WindowActivate and WindowDeactivate event to check whether user release their mouse. (#401) 2022-03-13 21:22:07 +01:00
Uwe Kindler
6a1ea6c7de Fixed examples/sidebar bug 2022-03-04 13:43:21 +01:00
Uwe Kindler
931719c474 Updated README.md 2022-03-04 08:04:21 +01:00
Uwe Kindler
70ef00932a Updated marketplace description 2022-03-02 11:52:38 +01:00
Uwe Kindler
a1bc4a063b Updated qt_markectplace files 2022-03-02 11:48:51 +01:00
Uwe Kindler
abf7224582 Updated ads logo and icon 2022-03-02 11:31:25 +01:00
Uwe Kindler
7ab4c9af2e Handle StyleChange event in DockWidgetTab to update icon 2022-02-25 21:41:46 +01:00
30 changed files with 452 additions and 717 deletions

View File

@@ -1,10 +0,0 @@
from .ads import ads
from .._version import *
import inspect
for name, member in inspect.getmembers(ads):
if not name.startswith('_'):
globals()[name] = member
del ads

View File

@@ -1,9 +0,0 @@
from .rc import *
from ._version import get_versions
__version__ = get_versions()['version']
short_version = __version__
version = __version__
full_version = __version__
git_revision = get_versions()['full-revisionid']
release = not get_versions()['dirty']
del get_versions

View File

@@ -1,520 +0,0 @@
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains the computed version number.
# This file is released into the public domain. Generated by
# versioneer-0.18 (https://github.com/warner/python-versioneer)
"""Git implementation of _version.py."""
import errno
import os
import re
import subprocess
import sys
def get_keywords():
"""Get the keywords needed to look up the version information."""
# these strings will be replaced by git during git-archive.
# setup.py/versioneer.py will grep for the variable names, so they must
# each be defined on a line of their own. _version.py will just call
# get_keywords().
git_refnames = "$Format:%d$"
git_full = "$Format:%H$"
git_date = "$Format:%ci$"
keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
return keywords
class VersioneerConfig:
"""Container for Versioneer configuration parameters."""
def get_config():
"""Create, populate and return the VersioneerConfig() object."""
# these strings are filled in when 'setup.py versioneer' creates
# _version.py
cfg = VersioneerConfig()
cfg.VCS = "git"
cfg.style = "pep440"
cfg.tag_prefix = ""
cfg.parentdir_prefix = "None"
cfg.versionfile_source = "PyQtAds/_version.py"
cfg.verbose = False
return cfg
class NotThisMethod(Exception):
"""Exception raised if a method is not valid for the current scenario."""
LONG_VERSION_PY = {}
HANDLERS = {}
def register_vcs_handler(vcs, method): # decorator
"""Create decorator to mark a method as the handler of a VCS."""
def decorate(f):
"""Store f in HANDLERS[vcs][method]."""
if vcs not in HANDLERS:
HANDLERS[vcs] = {}
HANDLERS[vcs][method] = f
return f
return decorate
def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False,
env=None):
"""Call the given command(s)."""
assert isinstance(commands, list)
p = None
for c in commands:
try:
dispcmd = str([c] + args)
# remember shell=False, so use git.cmd on windows, not just git
p = subprocess.Popen([c] + args, cwd=cwd, env=env,
stdout=subprocess.PIPE,
stderr=(subprocess.PIPE if hide_stderr
else None))
break
except EnvironmentError:
e = sys.exc_info()[1]
if e.errno == errno.ENOENT:
continue
if verbose:
print("unable to run %s" % dispcmd)
print(e)
return None, None
else:
if verbose:
print("unable to find command, tried %s" % (commands,))
return None, None
stdout = p.communicate()[0].strip()
if sys.version_info[0] >= 3:
stdout = stdout.decode()
if p.returncode != 0:
if verbose:
print("unable to run %s (error)" % dispcmd)
print("stdout was %s" % stdout)
return None, p.returncode
return stdout, p.returncode
def versions_from_parentdir(parentdir_prefix, root, verbose):
"""Try to determine the version from the parent directory name.
Source tarballs conventionally unpack into a directory that includes both
the project name and a version string. We will also support searching up
two directory levels for an appropriately named parent directory
"""
rootdirs = []
for i in range(3):
dirname = os.path.basename(root)
if dirname.startswith(parentdir_prefix):
return {"version": dirname[len(parentdir_prefix):],
"full-revisionid": None,
"dirty": False, "error": None, "date": None}
else:
rootdirs.append(root)
root = os.path.dirname(root) # up a level
if verbose:
print("Tried directories %s but none started with prefix %s" %
(str(rootdirs), parentdir_prefix))
raise NotThisMethod("rootdir doesn't start with parentdir_prefix")
@register_vcs_handler("git", "get_keywords")
def git_get_keywords(versionfile_abs):
"""Extract version information from the given file."""
# the code embedded in _version.py can just fetch the value of these
# keywords. When used from setup.py, we don't want to import _version.py,
# so we do it with a regexp instead. This function is not used from
# _version.py.
keywords = {}
try:
f = open(versionfile_abs, "r")
for line in f.readlines():
if line.strip().startswith("git_refnames ="):
mo = re.search(r'=\s*"(.*)"', line)
if mo:
keywords["refnames"] = mo.group(1)
if line.strip().startswith("git_full ="):
mo = re.search(r'=\s*"(.*)"', line)
if mo:
keywords["full"] = mo.group(1)
if line.strip().startswith("git_date ="):
mo = re.search(r'=\s*"(.*)"', line)
if mo:
keywords["date"] = mo.group(1)
f.close()
except EnvironmentError:
pass
return keywords
@register_vcs_handler("git", "keywords")
def git_versions_from_keywords(keywords, tag_prefix, verbose):
"""Get version information from git keywords."""
if not keywords:
raise NotThisMethod("no keywords at all, weird")
date = keywords.get("date")
if date is not None:
# git-2.2.0 added "%cI", which expands to an ISO-8601 -compliant
# datestamp. However we prefer "%ci" (which expands to an "ISO-8601
# -like" string, which we must then edit to make compliant), because
# it's been around since git-1.5.3, and it's too difficult to
# discover which version we're using, or to work around using an
# older one.
date = date.strip().replace(" ", "T", 1).replace(" ", "", 1)
refnames = keywords["refnames"].strip()
if refnames.startswith("$Format"):
if verbose:
print("keywords are unexpanded, not using")
raise NotThisMethod("unexpanded keywords, not a git-archive tarball")
refs = set([r.strip() for r in refnames.strip("()").split(",")])
# starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of
# just "foo-1.0". If we see a "tag: " prefix, prefer those.
TAG = "tag: "
tags = set([r[len(TAG):] for r in refs if r.startswith(TAG)])
if not tags:
# Either we're using git < 1.8.3, or there really are no tags. We use
# a heuristic: assume all version tags have a digit. The old git %d
# expansion behaves like git log --decorate=short and strips out the
# refs/heads/ and refs/tags/ prefixes that would let us distinguish
# between branches and tags. By ignoring refnames without digits, we
# filter out many common branch names like "release" and
# "stabilization", as well as "HEAD" and "master".
tags = set([r for r in refs if re.search(r'\d', r)])
if verbose:
print("discarding '%s', no digits" % ",".join(refs - tags))
if verbose:
print("likely tags: %s" % ",".join(sorted(tags)))
for ref in sorted(tags):
# sorting will prefer e.g. "2.0" over "2.0rc1"
if ref.startswith(tag_prefix):
r = ref[len(tag_prefix):]
if verbose:
print("picking %s" % r)
return {"version": r,
"full-revisionid": keywords["full"].strip(),
"dirty": False, "error": None,
"date": date}
# no suitable tags, so version is "0+unknown", but full hex is still there
if verbose:
print("no suitable tags, using unknown + full revision id")
return {"version": "0+unknown",
"full-revisionid": keywords["full"].strip(),
"dirty": False, "error": "no suitable tags", "date": None}
@register_vcs_handler("git", "pieces_from_vcs")
def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
"""Get version from 'git describe' in the root of the source tree.
This only gets called if the git-archive 'subst' keywords were *not*
expanded, and _version.py hasn't already been rewritten with a short
version string, meaning we're inside a checked out source tree.
"""
GITS = ["git"]
if sys.platform == "win32":
GITS = ["git.cmd", "git.exe"]
out, rc = run_command(GITS, ["rev-parse", "--git-dir"], cwd=root,
hide_stderr=True)
if rc != 0:
if verbose:
print("Directory %s not under git control" % root)
raise NotThisMethod("'git rev-parse --git-dir' returned error")
# if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty]
# if there isn't one, this yields HEX[-dirty] (no NUM)
describe_out, rc = run_command(GITS, ["describe", "--tags", "--dirty",
"--always", "--long",
"--match", "%s*" % tag_prefix],
cwd=root)
# --long was added in git-1.5.5
if describe_out is None:
raise NotThisMethod("'git describe' failed")
describe_out = describe_out.strip()
full_out, rc = run_command(GITS, ["rev-parse", "HEAD"], cwd=root)
if full_out is None:
raise NotThisMethod("'git rev-parse' failed")
full_out = full_out.strip()
pieces = {}
pieces["long"] = full_out
pieces["short"] = full_out[:7] # maybe improved later
pieces["error"] = None
# parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty]
# TAG might have hyphens.
git_describe = describe_out
# look for -dirty suffix
dirty = git_describe.endswith("-dirty")
pieces["dirty"] = dirty
if dirty:
git_describe = git_describe[:git_describe.rindex("-dirty")]
# now we have TAG-NUM-gHEX or HEX
if "-" in git_describe:
# TAG-NUM-gHEX
mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe)
if not mo:
# unparseable. Maybe git-describe is misbehaving?
pieces["error"] = ("unable to parse git-describe output: '%s'"
% describe_out)
return pieces
# tag
full_tag = mo.group(1)
if not full_tag.startswith(tag_prefix):
if verbose:
fmt = "tag '%s' doesn't start with prefix '%s'"
print(fmt % (full_tag, tag_prefix))
pieces["error"] = ("tag '%s' doesn't start with prefix '%s'"
% (full_tag, tag_prefix))
return pieces
pieces["closest-tag"] = full_tag[len(tag_prefix):]
# distance: number of commits since tag
pieces["distance"] = int(mo.group(2))
# commit: short hex revision ID
pieces["short"] = mo.group(3)
else:
# HEX: no tags
pieces["closest-tag"] = None
count_out, rc = run_command(GITS, ["rev-list", "HEAD", "--count"],
cwd=root)
pieces["distance"] = int(count_out) # total number of commits
# commit date: see ISO-8601 comment in git_versions_from_keywords()
date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"],
cwd=root)[0].strip()
pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1)
return pieces
def plus_or_dot(pieces):
"""Return a + if we don't already have one, else return a ."""
if "+" in pieces.get("closest-tag", ""):
return "."
return "+"
def render_pep440(pieces):
"""Build up version string, with post-release "local version identifier".
Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you
get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty
Exceptions:
1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty]
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"] or pieces["dirty"]:
rendered += plus_or_dot(pieces)
rendered += "%d.g%s" % (pieces["distance"], pieces["short"])
if pieces["dirty"]:
rendered += ".dirty"
else:
# exception #1
rendered = "0+untagged.%d.g%s" % (pieces["distance"],
pieces["short"])
if pieces["dirty"]:
rendered += ".dirty"
return rendered
def render_pep440_pre(pieces):
"""TAG[.post.devDISTANCE] -- No -dirty.
Exceptions:
1: no tags. 0.post.devDISTANCE
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"]:
rendered += ".post.dev%d" % pieces["distance"]
else:
# exception #1
rendered = "0.post.dev%d" % pieces["distance"]
return rendered
def render_pep440_post(pieces):
"""TAG[.postDISTANCE[.dev0]+gHEX] .
The ".dev0" means dirty. Note that .dev0 sorts backwards
(a dirty tree will appear "older" than the corresponding clean one),
but you shouldn't be releasing software with -dirty anyways.
Exceptions:
1: no tags. 0.postDISTANCE[.dev0]
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"] or pieces["dirty"]:
rendered += ".post%d" % pieces["distance"]
if pieces["dirty"]:
rendered += ".dev0"
rendered += plus_or_dot(pieces)
rendered += "g%s" % pieces["short"]
else:
# exception #1
rendered = "0.post%d" % pieces["distance"]
if pieces["dirty"]:
rendered += ".dev0"
rendered += "+g%s" % pieces["short"]
return rendered
def render_pep440_old(pieces):
"""TAG[.postDISTANCE[.dev0]] .
The ".dev0" means dirty.
Exceptions:
1: no tags. 0.postDISTANCE[.dev0]
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"] or pieces["dirty"]:
rendered += ".post%d" % pieces["distance"]
if pieces["dirty"]:
rendered += ".dev0"
else:
# exception #1
rendered = "0.post%d" % pieces["distance"]
if pieces["dirty"]:
rendered += ".dev0"
return rendered
def render_git_describe(pieces):
"""TAG[-DISTANCE-gHEX][-dirty].
Like 'git describe --tags --dirty --always'.
Exceptions:
1: no tags. HEX[-dirty] (note: no 'g' prefix)
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"]:
rendered += "-%d-g%s" % (pieces["distance"], pieces["short"])
else:
# exception #1
rendered = pieces["short"]
if pieces["dirty"]:
rendered += "-dirty"
return rendered
def render_git_describe_long(pieces):
"""TAG-DISTANCE-gHEX[-dirty].
Like 'git describe --tags --dirty --always -long'.
The distance/hash is unconditional.
Exceptions:
1: no tags. HEX[-dirty] (note: no 'g' prefix)
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
rendered += "-%d-g%s" % (pieces["distance"], pieces["short"])
else:
# exception #1
rendered = pieces["short"]
if pieces["dirty"]:
rendered += "-dirty"
return rendered
def render(pieces, style):
"""Render the given version pieces into the requested style."""
if pieces["error"]:
return {"version": "unknown",
"full-revisionid": pieces.get("long"),
"dirty": None,
"error": pieces["error"],
"date": None}
if not style or style == "default":
style = "pep440" # the default
if style == "pep440":
rendered = render_pep440(pieces)
elif style == "pep440-pre":
rendered = render_pep440_pre(pieces)
elif style == "pep440-post":
rendered = render_pep440_post(pieces)
elif style == "pep440-old":
rendered = render_pep440_old(pieces)
elif style == "git-describe":
rendered = render_git_describe(pieces)
elif style == "git-describe-long":
rendered = render_git_describe_long(pieces)
else:
raise ValueError("unknown style '%s'" % style)
return {"version": rendered, "full-revisionid": pieces["long"],
"dirty": pieces["dirty"], "error": None,
"date": pieces.get("date")}
def get_versions():
"""Get version information or return default if unable to do so."""
# I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have
# __file__, we can work backwards from there to the root. Some
# py2exe/bbfreeze/non-CPython implementations don't do __file__, in which
# case we can only use expanded keywords.
cfg = get_config()
verbose = cfg.verbose
try:
return git_versions_from_keywords(get_keywords(), cfg.tag_prefix,
verbose)
except NotThisMethod:
pass
try:
root = os.path.realpath(__file__)
# versionfile_source is the relative path from the top of the source
# tree (where the .git directory might live) to this file. Invert
# this to find the root from __file__.
for i in cfg.versionfile_source.split('/'):
root = os.path.dirname(root)
except NameError:
return {"version": "0+unknown", "full-revisionid": None,
"dirty": None,
"error": "unable to find root of source tree",
"date": None}
try:
pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose)
return render(pieces, cfg.style)
except NotThisMethod:
pass
try:
if cfg.parentdir_prefix:
return versions_from_parentdir(cfg.parentdir_prefix, root, verbose)
except NotThisMethod:
pass
return {"version": "0+unknown", "full-revisionid": None,
"dirty": None,
"error": "unable to compute version", "date": None}

View File

@@ -1,10 +1,14 @@
# Advanced Docking System for Qt ![ukraine](doc/ukraine.jpg)
![logo](doc/ads_logo.svg)
------------------
[![Build status](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/workflows/linux-builds/badge.svg)](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/actions?query=workflow%3Alinux-builds) [![Build status](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/workflows/linux-builds/badge.svg)](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/actions?query=workflow%3Alinux-builds)
[![Build status](https://ci.appveyor.com/api/projects/status/qcfb3cy932jw9mpy/branch/master?svg=true)](https://ci.appveyor.com/project/githubuser0xFFFF/qt-advanced-docking-system/branch/master) [![Build status](https://ci.appveyor.com/api/projects/status/qcfb3cy932jw9mpy/branch/master?svg=true)](https://ci.appveyor.com/project/githubuser0xFFFF/qt-advanced-docking-system/branch/master)
[![License: LGPL v2.1](https://img.shields.io/badge/License-LGPL%20v2.1-blue.svg)](gnu-lgpl-v2.1.md) [![License: LGPL v2.1](https://img.shields.io/badge/License-LGPL%20v2.1-blue.svg)](gnu-lgpl-v2.1.md)
[What's new](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/releases/latest) [What's new](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/releases/latest)
[Documentation](doc/user-guide.md) [Documentation](doc/user-guide.md)
Qt Advanced Docking System lets you create customizable layouts using a full Qt Advanced Docking System lets you create customizable layouts using a full
@@ -15,7 +19,7 @@ integrated development environments (IDEs) such as Visual Studio.
## New and Noteworthy ## New and Noteworthy
The [release 3.8](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/releases/tag/3.8.1) The [release 3.8](https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/releases/latest)
adds the following features: adds the following features:
- option to close tabs with the middle mouse button - option to close tabs with the middle mouse button
@@ -84,13 +88,15 @@ know it from Visual Studio.
- [Showcase](#showcase) - [Showcase](#showcase)
- [Qt Creator IDE](#qt-creator-ide) - [Qt Creator IDE](#qt-creator-ide)
- [Qt Design Studio](#qt-design-studio) - [Qt Design Studio](#qt-design-studio)
- [QmixElements](#qmixelements) - [CETONI Elements](#cetoni-elements)
- [ezEditor](#ezeditor) - [ezEditor](#ezeditor)
- [D-Tect X](#d-tect-x) - [D-Tect X](#d-tect-x)
- [HiveWE](#hivewe) - [HiveWE](#hivewe)
- [Ramses Composer](#ramses-composer) - [Ramses Composer](#ramses-composer)
- [Plot Juggler](#plot-juggler) - [Plot Juggler](#plot-juggler)
- [Notepad Next](#notepad-next) - [Notepad Next](#notepad-next)
- [MetGem](#metgem)
- [PRE Workbench](#pre-workbench)
### Docking everywhere - no central widget ### Docking everywhere - no central widget
@@ -282,8 +288,9 @@ MainWindow::MainWindow(QWidget *parent) :
{ {
ui->setupUi(this); ui->setupUi(this);
// Create the dock manager. Because the parent parameter is a QMainWindow // Create the dock manager after the ui is setup. Because the
// the dock manager registers itself as the central widget. // parent parameter is a QMainWindow the dock manager registers
// itself as the central widget as such the ui must be set up first.
m_DockManager = new ads::CDockManager(this); m_DockManager = new ads::CDockManager(this);
// Create example content label - this can be any application specific // Create example content label - this can be any application specific
@@ -374,9 +381,8 @@ Taken from the [Qt Blog](https://www.qt.io/blog/qt-design-studio-1.5-beta-releas
### [CETONI Elements](https://www.cetoni.com/products/qmixelements/) ### [CETONI Elements](https://www.cetoni.com/products/qmixelements/)
The CETONI Elements software from [CETONI](https://www.cetoni.com) is a comprehensive, The CETONI Elements software from [CETONI](https://www.cetoni.com) is a comprehensive,
plugin-based and modular laboratory automation software for controlling CETONI devices using a joint graphical user interface. The software features a powerful script system to automate processes. This [blog post](https://www.cetoni.com/blog/qmixelements-advanced-docking-system/) gives a nice overview about the use of the Qt plugin-based and modular laboratory automation software for controlling CETONI devices using a joint graphical user interface. The software features a powerful script system to automate processes. The software uses the advanced docking system to give the user the freedom to arrange all the views and windows that are provided by the various plugins.
Advanced Docking System in the CETONI Elements sofware.
![CETONI_Elements](doc/showcase_qmix_elements.png) ![CETONI_Elements](doc/showcase_qmix_elements.png)
@@ -448,6 +454,27 @@ highlights are:
Notepad Next is a cross-platform reimplementation of Notepad++ that uses the Notepad Next is a cross-platform reimplementation of Notepad++ that uses the
Advanced Docking System to arrange the open source files on the screen. Advanced Docking System to arrange the open source files on the screen.
[learn more...](https://github.com/dail8859/NotepadNext) [read more...](https://github.com/dail8859/NotepadNext)
![NotepadNext](doc/showcase_notepad_next.png) ![NotepadNext](doc/showcase_notepad_next.png)
### [MetGem](https://metgem.github.io/)
MetGem is an open-source software for tandem mass-spectrometry data visualization.
It's key features are standalone molecular networking and t-SNE based projections.
MetGem uses the Qt-Advanced-Docking-System to manage docks and to create independent
molecular network views.
[read more...](https://metgem.github.io/)
![MetGem](doc/showcase_metgem.png)
### [PRE Workbench](https://luelista.github.io/pre_workbench/)
Protocol Reverse Engineering Workbench is a software to support researchers in reverse engineering protocols and documenting the results. It supports various sources to import protocol traffic from, helps the discovery process by displaying different views and heuristic-based highlighting on data, and aids in documenting and sharing findings.
PRE Workbench is a Python software and uses the ADS PyQt integration.
[read more...](https://luelista.github.io/pre_workbench/)
[![PRE Workbench](doc/showcase_pre_workbench.png)](https://youtu.be/U3op5UreV1Q)

View File

@@ -1,6 +1,6 @@
CONFIG(debug, debug|release){ CONFIG(debug, debug|release){
win32 { win32-g++ {
versionAtLeast(QT_VERSION, 5.15.0) { versionAtLeast(QT_VERSION, 5.15.0) {
LIBS += -lqtadvanceddocking LIBS += -lqtadvanceddocking
} }
@@ -8,6 +8,9 @@ CONFIG(debug, debug|release){
LIBS += -lqtadvanceddockingd LIBS += -lqtadvanceddockingd
} }
} }
else:msvc {
LIBS += -lqtadvanceddockingd
}
else:mac { else:mac {
LIBS += -lqtadvanceddocking_debug LIBS += -lqtadvanceddocking_debug
} }

View File

@@ -433,6 +433,7 @@ void MainWindowPrivate::createContent()
int Width = Splitter->width(); int Width = Splitter->width();
Splitter->setSizes({Width * 2/3, Width * 1/3}); Splitter->setSizes({Width * 2/3, Width * 1/3});
}); });
DockWidget->setWindowTitle(QString("My " + DockWidget->windowTitle()));
// Now we add a custom button to the dock area title bar that will create // Now we add a custom button to the dock area title bar that will create
// new editor widgets when clicked // new editor widgets when clicked
@@ -457,7 +458,21 @@ void MainWindowPrivate::createContent()
DockManager->addDockWidget(ads::TopDockWidgetArea, createLongTextLabelDockWidget(), RighDockArea); DockManager->addDockWidget(ads::TopDockWidgetArea, createLongTextLabelDockWidget(), RighDockArea);
auto BottomDockArea = DockManager->addDockWidget(ads::BottomDockWidgetArea, createLongTextLabelDockWidget(), RighDockArea); auto BottomDockArea = DockManager->addDockWidget(ads::BottomDockWidgetArea, createLongTextLabelDockWidget(), RighDockArea);
DockManager->addDockWidget(ads::CenterDockWidgetArea, createLongTextLabelDockWidget(), RighDockArea); DockManager->addDockWidget(ads::CenterDockWidgetArea, createLongTextLabelDockWidget(), RighDockArea);
DockManager->addDockWidget(ads::CenterDockWidgetArea, createLongTextLabelDockWidget(), BottomDockArea); auto LabelDockWidget = createLongTextLabelDockWidget();
std::cout << "DockWidget " << LabelDockWidget->objectName().toStdString() << std::endl;
DockManager->addDockWidget(ads::CenterDockWidgetArea, LabelDockWidget, BottomDockArea);
// Tests CustomCloseHandling without DeleteOnClose
LabelDockWidget->setFeature(ads::CDockWidget::CustomCloseHandling, true);
QObject::connect(LabelDockWidget, &ads::CDockWidget::closeRequested, [LabelDockWidget, this]()
{
int Result = QMessageBox::question(_this, "Custom Close Request",
"Do you really want to close this dock widget?");
if (QMessageBox::Yes == Result)
{
LabelDockWidget->closeDockWidget();
}
});
Action = ui.menuTests->addAction(QString("Set %1 Floating").arg(DockWidget->windowTitle())); Action = ui.menuTests->addAction(QString("Set %1 Floating").arg(DockWidget->windowTitle()));
DockWidget->connect(Action, SIGNAL(triggered()), SLOT(setFloating())); DockWidget->connect(Action, SIGNAL(triggered()), SLOT(setFloating()));
@@ -474,6 +489,7 @@ void MainWindowPrivate::createContent()
// Test visible floating dock widget // Test visible floating dock widget
DockWidget = createCalendarDockWidget(); DockWidget = createCalendarDockWidget();
DockManager->addDockWidgetFloating(DockWidget); DockManager->addDockWidgetFloating(DockWidget);
DockWidget->setWindowTitle(QString("My " + DockWidget->windowTitle()));
#ifdef Q_OS_WIN #ifdef Q_OS_WIN

View File

@@ -1,123 +1,77 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg <svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1" version="1.1"
viewBox="0,0,1024,1024" viewBox="0 0 1023.99 1023.99"
id="svg1145" id="svg26"
sodipodi:docname="ads_icon.svg" sodipodi:docname="ads_icon.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)" inkscape:version="1.1 (c68e22c387, 2021-05-23)"
inkscape:export-filename="C:\CodingXP\cetoni_projects\QtAdvancedDockingSystem\doc\ads_icon_256.png" width="1023.99"
inkscape:export-xdpi="24" height="1023.99"
inkscape:export-ydpi="24"> xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
<metadata xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
id="metadata1151"> xmlns="http://www.w3.org/2000/svg"
<rdf:RDF> xmlns:svg="http://www.w3.org/2000/svg">
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs <defs
id="defs1149" /> id="defs30" />
<sodipodi:namedview <sodipodi:namedview
id="namedview28"
pagecolor="#ffffff" pagecolor="#ffffff"
bordercolor="#666666" bordercolor="#666666"
borderopacity="1" borderopacity="1.0"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2" inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:zoom="0.12999302"
inkscape:cx="3277.099"
inkscape:cy="-257.70614"
inkscape:window-width="1920" inkscape:window-width="1920"
inkscape:window-height="1017" inkscape:window-height="1017"
id="namedview1147"
showgrid="false"
inkscape:zoom="0.32593202"
inkscape:cx="256.13402"
inkscape:cy="235.82602"
inkscape:window-x="1912" inkscape:window-x="1912"
inkscape:window-y="-8" inkscape:window-y="-8"
inkscape:window-maximized="1" inkscape:window-maximized="1"
inkscape:current-layer="svg1145" /> inkscape:current-layer="svg26"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<desc <desc
id="desc1129">window_size icon - Licensed under Iconfu Standard License v1.0 (https://www.iconfu.com/iconfu_standard_license) - Incors GmbH</desc> id="desc2">electric_iron icon - Licensed under Iconfu Standard License v1.0 (https://www.iconfu.com/iconfu_standard_license) - Incors GmbH</desc>
<path <text
id="path1797-1" xml:space="preserve"
visibility="hidden" style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none"
d="M 71.53142,291.89723 H 950.1828 l 0.6743,0.6742 v 586.08 l -0.6743,0.6743 H 71.53142 l -0.6743,-0.6743 v -586.08 z" x="1251.1022"
inkscape:connector-curvature="0" y="1305.4956"
style="visibility:hidden;mix-blend-mode:normal;fill:#ffffff;fill-rule:nonzero;stroke-width:0.99999988;fill-opacity:1" /> id="text9788"><tspan
<rect sodipodi:role="line"
transform="rotate(-90)" id="tspan9786"
y="412.13489" x="1251.1022"
x="-911.34436" y="1305.4956" /></text>
height="560.90375" <g
width="327.70862" id="g94691"
id="rect1739-8" transform="translate(581.23034,1750.5233)">
style="opacity:1;fill:#ffd292;fill-opacity:1;stroke:none;stroke-width:37.79526901;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" /> <path
<path d="m 191.63966,-726.53328 h -521.75 c -138.69,0 -251.12,-112.43001 -251.12,-251.12 v -521.75002 c 0,-138.69 112.43,-251.12 251.12,-251.12 h 521.75 c 138.69,0 251.12,112.43 251.12,251.12 v 521.75002 c 0,138.68999 -112.43,251.12 -251.12,251.12 z"
id="path1799" fill="#707070"
d="M 988.40121,578.11175 V 651.2546 H 409.96541 V 578.11175 Z" id="path4-5"
inkscape:connector-curvature="0" style="mix-blend-mode:normal;fill:#e0e0e0;fill-opacity:1;fill-rule:nonzero" />
style="mix-blend-mode:normal;fill:#546e7a;fill-rule:nonzero;stroke-width:0.99999988" /> <path
<rect id="path927"
style="opacity:1;fill:#b3c3cb;fill-opacity:1;stroke:none;stroke-width:37.79526901;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" style="mix-blend-mode:normal;fill:#009ddd;fill-opacity:1;fill-rule:nonzero"
id="rect1739-6-1" d="m -175.90039,-1515.8633 v 256 h 469.3301 v -256 z" />
width="655.41724" <path
height="338.99207" id="path16513"
x="-914.85529" style="mix-blend-mode:normal;fill:#ff9833;fill-opacity:1;fill-rule:nonzero"
y="38.243896" d="m 80.099609,-1217.1934 v 256.00004 H 293.42969 v -256.00004 z" />
transform="rotate(-90)" /> <path
<path id="path16513-5"
id="path1801-7" style="mix-blend-mode:normal;fill:#accb01;fill-opacity:1;fill-rule:nonzero"
d="m 73.1429,73.14287 h 877.7142 c 40.2857,0 73.1429,32.86857 73.1429,73.14285 V 914.2857 c 0,20.12571 -16.4458,36.57142 -36.5715,36.57142 H 36.5714 C 16.4343,950.85712 0,934.42284 0,914.2857 V 146.28572 C 0,106.00001 32.8571,73.14287 73.1429,73.14287 Z m 0,219.42856 V 877.71427 H 950.8571 V 292.57143 Z" d="m -175.90039,-1217.1933 v 256 H 37.42969 v -256 z" />
inkscape:connector-curvature="0" <path
style="mix-blend-mode:normal;fill:#546e7a;fill-rule:nonzero;stroke-width:0.99999988" /> id="path24788"
<path style="mix-blend-mode:normal;fill:#0083c3;fill-opacity:1;fill-rule:nonzero"
id="path1799-6" d="m -431.90039,-1515.8633 v 554.66994 h 213.33008 v -554.66994 z" />
d="M 359.8801,276.79402 H 433.023 V 886.78767 H 359.8801 Z" </g>
inkscape:connector-curvature="0"
style="mix-blend-mode:normal;fill:#546e7a;fill-rule:nonzero;stroke-width:0.99999988" />
<circle
r="36.81749"
cy="169.78555"
cx="920.66248"
id="path1917-42"
style="opacity:1;fill:#ffa726;fill-opacity:1;stroke:none;stroke-width:63.79999924;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" />
<circle
r="36.81749"
cy="169.78555"
cx="817.22302"
id="path1917-4-6"
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:63.79999924;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" />
<path
id="path1799-8"
d="m 615.67076,292.13464 v 73.14285 H 433.023 v -73.14285 z"
inkscape:connector-curvature="0"
style="mix-blend-mode:normal;fill:#95abb6;fill-rule:nonzero;stroke-width:0.99999994;fill-opacity:1" />
<path
id="path1799-8-1"
d="m 798.31852,292.13464 v 73.14285 H 615.67076 v -73.14285 z"
inkscape:connector-curvature="0"
style="mix-blend-mode:normal;fill:#c7d4d9;fill-rule:nonzero;stroke-width:0.99999994;fill-opacity:1" />
<path
id="path1799-8-7"
d="m 255.79066,292.57143 v 73.14285 H 73.1429 v -73.14285 z"
inkscape:connector-curvature="0"
style="mix-blend-mode:normal;fill:#dfe5e9;fill-opacity:1;fill-rule:nonzero;stroke-width:0.99999994" />
<path
id="path1799-8-7-6"
d="m 616.34083,651.15739 v 73.14285 H 433.69307 v -73.14285 z"
inkscape:connector-curvature="0"
style="mix-blend-mode:normal;fill:#ffba56;fill-opacity:1;fill-rule:nonzero;stroke-width:0.99999994" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

88
doc/ads_logo.svg Normal file
View File

@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
version="1.1"
viewBox="0 0 6907.3028 1023.99"
id="svg26"
sodipodi:docname="ads_logo.svg"
inkscape:version="1.1 (c68e22c387, 2021-05-23)"
width="6907.3027"
height="1023.99"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs30" />
<sodipodi:namedview
id="namedview28"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:zoom="0.12999302"
inkscape:cx="3277.099"
inkscape:cy="-257.70614"
inkscape:window-width="1920"
inkscape:window-height="1017"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg26"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<desc
id="desc2">electric_iron icon - Licensed under Iconfu Standard License v1.0 (https://www.iconfu.com/iconfu_standard_license) - Incors GmbH</desc>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none"
x="1251.1022"
y="1305.4956"
id="text9788"><tspan
sodipodi:role="line"
id="tspan9786"
x="1251.1022"
y="1305.4956" /></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:628.003px;line-height:1.25;font-family:sans-serif;fill:#8f918f;fill-opacity:1;stroke:none;stroke-width:1"
x="1178.9221"
y="718.37329"
id="text15608"><tspan
sodipodi:role="line"
id="tspan15606"
x="1178.9221"
y="718.37329"
style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:628.003px;font-family:'Segoe UI';-inkscape-font-specification:'Segoe UI Light';fill:#8f918f;fill-opacity:1;stroke-width:1">Qt Advanced Docking</tspan></text>
<g
id="g94691"
transform="translate(581.23034,1750.5233)">
<path
d="m 191.63966,-726.53328 h -521.75 c -138.69,0 -251.12,-112.43001 -251.12,-251.12 v -521.75002 c 0,-138.69 112.43,-251.12 251.12,-251.12 h 521.75 c 138.69,0 251.12,112.43 251.12,251.12 v 521.75002 c 0,138.68999 -112.43,251.12 -251.12,251.12 z"
fill="#707070"
id="path4-5"
style="mix-blend-mode:normal;fill:#e0e0e0;fill-opacity:1;fill-rule:nonzero" />
<path
id="path927"
style="mix-blend-mode:normal;fill:#009ddd;fill-opacity:1;fill-rule:nonzero"
d="m -175.90039,-1515.8633 v 256 h 469.3301 v -256 z" />
<path
id="path16513"
style="mix-blend-mode:normal;fill:#ff9833;fill-opacity:1;fill-rule:nonzero"
d="m 80.099609,-1217.1934 v 256.00004 H 293.42969 v -256.00004 z" />
<path
id="path16513-5"
style="mix-blend-mode:normal;fill:#accb01;fill-opacity:1;fill-rule:nonzero"
d="m -175.90039,-1217.1933 v 256 H 37.42969 v -256 z" />
<path
id="path24788"
style="mix-blend-mode:normal;fill:#0083c3;fill-opacity:1;fill-rule:nonzero"
d="m -431.90039,-1515.8633 v 554.66994 h 213.33008 v -554.66994 z" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -12,20 +12,6 @@ styles as much as possible.
## Features ## Features
### Overview
- [Features](#features)
- [Overview](#overview)
- [Docking everywhere - no central widget](#docking-everywhere---no-central-widget)
- [Docking inside floating windows](#docking-inside-floating-windows)
- [Grouped dragging](#grouped-dragging)
- [Perspectives for fast switching of the complete main window layout](#perspectives-for-fast-switching-of-the-complete-main-window-layout)
- [Opaque and non-opaque splitter resizing](#opaque-and-non-opaque-splitter-resizing)
- [Opaque and non-opaque undocking](#opaque-and-non-opaque-undocking)
- [Tab-menu for easy handling of many tabbed dock widgets](#tab-menu-for-easy-handling-of-many-tabbed-dock-widgets)
- [Many different ways to detach dock widgets](#many-different-ways-to-detach-dock-widgets)
- [Supports deletion of dynamically created dock widgets](#supports-deletion-of-dynamically-created-dock-widgets)
### Docking everywhere - no central widget ### Docking everywhere - no central widget
There is no central widget like in the Qt docking system. You can dock on every There is no central widget like in the Qt docking system. You can dock on every
@@ -106,3 +92,10 @@ You can detach dock widgets and also dock areas in the following ways:
### Supports deletion of dynamically created dock widgets ### Supports deletion of dynamically created dock widgets
Normally clicking the close button of a dock widget will just hide the widget and the user can show it again using the toggleView() action of the dock widget. This is meant for user interfaces with a static amount of widgets. But the advanced docking system also supports dynamic dock widgets that will get deleted on close. If you set the dock widget flag `DockWidgetDeleteOnClose` for a certain dock widget, then it will be deleted as soon as you close this dock widget. This enables the implementation of user interfaces with dynamically created editors, like in word processing applications or source code development tools. Normally clicking the close button of a dock widget will just hide the widget and the user can show it again using the toggleView() action of the dock widget. This is meant for user interfaces with a static amount of widgets. But the advanced docking system also supports dynamic dock widgets that will get deleted on close. If you set the dock widget flag `DockWidgetDeleteOnClose` for a certain dock widget, then it will be deleted as soon as you close this dock widget. This enables the implementation of user interfaces with dynamically created editors, like in word processing applications or source code development tools.
### Python PyQt5 Bindings
![Python Logo](https://raw.githubusercontent.com/githubuser0xFFFF/Qt-Advanced-Docking-System/master/doc/python_logo.png)
The Advanced Docking System comes with a complete Python integration based on
PyQt5 bindings. The package is available via [conda-forge](https://github.com/conda-forge/pyqtads-feedstock).

View File

@@ -4,21 +4,21 @@
"extensionType": [ "extensionType": [
"library" "library"
], ],
"version": "3.0.0", "version": "3.8.2",
"vendor": { "vendor": {
"name": "githubuser0xFFFF", "name": "githubuser0xFFFF",
"url": "https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System" "url": "https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System"
}, },
"contact": "https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues", "contact": "https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues",
"icon": "https://raw.githubusercontent.com/githubuser0xFFFF/Qt-Advanced-Docking-System/master/doc/ads_icon_512.png", "icon": "https://raw.githubusercontent.com/githubuser0xFFFF/Qt-Advanced-Docking-System/master/doc/ads_icon.svg",
"licenses": [ "licenses": [
{ "licenseType": "LGPLv2.1", { "licenseType": "LGPL-2.1-only",
"licenseUrl": "https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html" } "licenseUrl": "https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html" }
], ],
"created": "2017-03-30", "created": "2017-03-30",
"lastUpdate": "2020-01-16", "lastUpdate": "2022-03-02",
"platforms": [ "platforms": [
"Windows 7-10", "Kubuntu 18.04", "Kubuntu 19.10", "Ubuntu 19.10" "Windows 7-11", "Kubuntu 18.04", "Kubuntu 19.10", "Ubuntu 19.10", "Ubuntu 20.04"
], ],
"qtVersions": [ "qtVersions": [
"5.5.1 or newer" "5.5.1 or newer"

BIN
doc/showcase_metgem.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

BIN
doc/ukraine.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

View File

@@ -52,9 +52,10 @@ configuration will be explained in detail in the following sections.
### Setting Configuration Flags ### Setting Configuration Flags
You should set the configuration flags before you create the dock manager You must set the configuration flags before creating the dock manager
instance. That means, setting the configurations flags is the first thing instance otherwise the manager will not be created correctly and will
you do, if you use the library. crash upon being created. That means, setting the configurations flags
is the first thing you must do, if you use the library.
```c++ ```c++
CDockManager::setConfigFlags(CDockManager::DefaultOpaqueConfig); CDockManager::setConfigFlags(CDockManager::DefaultOpaqueConfig);

View File

@@ -43,6 +43,7 @@ MainWindow::MainWindow(QWidget *parent) :
QPlainTextEdit* te = new QPlainTextEdit(); QPlainTextEdit* te = new QPlainTextEdit();
te->setPlaceholderText("Please enter your text here into this QPlainTextEdit..."); te->setPlaceholderText("Please enter your text here into this QPlainTextEdit...");
DockWidget = new ads::CDockWidget("Editor 1"); DockWidget = new ads::CDockWidget("Editor 1");
DockWidget->setWidget(te);
ui->menuView->addAction(DockWidget->toggleViewAction()); ui->menuView->addAction(DockWidget->toggleViewAction());
m_DockManager->addDockWidget(ads::BottomDockWidgetArea, DockWidget); m_DockManager->addDockWidget(ads::BottomDockWidgetArea, DockWidget);
} }

27
project.py Normal file
View File

@@ -0,0 +1,27 @@
import os
from pyqtbuild import PyQtBindings, PyQtProject
from sipbuild import Option
class PyQtAds(PyQtProject):
def __init__(self):
""" Initialise the project. """
super().__init__()
self.bindings_factories = [ads]
class ads(PyQtBindings):
def __init__(self, project):
""" Initialise the bindings. """
super().__init__(project, 'ads')
def apply_user_defaults(self, tool):
""" Set default values for user options that haven't been set yet. """
resource_file = os.path.join(self.project.root_dir,'src','ads.qrc')
print("Adding resource file to qmake project: ", resource_file)
self.builder_settings.append('RESOURCES += '+resource_file)
super().apply_user_defaults(tool)

65
pyproject.toml Normal file
View File

@@ -0,0 +1,65 @@
# Specify the build system.
[build-system]
requires = ["sip >=6.0.2, <6.6", "PyQt-builder >=1.6, <2", "PyQt5>=5.15.4", "PyQt5-sip<13,>=12.8"]
build-backend = "sipbuild.api"
# Specify the PEP 566 metadata for the project.
[tool.sip.metadata]
name = "PyQtAds"
version = "3.8.2"
summary = "Python bindings for Qt Advanced Docking System"
home-page = "https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/"
license = "LGPL v2.1"
description-file = "README.md"
requires-dist = "PyQt5 (>=5.15.4)"
description-content-type = "text/markdown"
[tool.sip.project]
tag-prefix = "QtAds"
[tool.sip.bindings.ads]
define-macros = ["ADS_SHARED_EXPORT"]
sip-file = "ads.sip"
include-dirs = ["src"]
qmake-QT = ["widgets"]
headers = [
"src/DockAreaTabBar.h",
"src/DockAreaTitleBar.h",
"src/DockAreaTitleBar_p.h",
"src/DockAreaWidget.h",
"src/DockComponentsFactory.h",
"src/DockContainerWidget.h",
"src/DockFocusController.h",
"src/DockManager.h",
"src/DockOverlay.h",
"src/DockSplitter.h",
"src/DockWidget.h",
"src/DockWidgetTab.h",
"src/DockingStateReader.h",
"src/ElidingLabel.h",
"src/FloatingDockContainer.h",
"src/FloatingDragPreview.h",
"src/IconProvider.h",
"src/ads_globals.h",
# "src/linux/FloatingWidgetTitleBar.h",
]
sources = [
"src/DockAreaTabBar.cpp",
"src/DockAreaTitleBar.cpp",
"src/DockAreaWidget.cpp",
"src/DockComponentsFactory.cpp",
"src/DockContainerWidget.cpp",
"src/DockFocusController.cpp",
"src/DockManager.cpp",
"src/DockOverlay.cpp",
"src/DockSplitter.cpp",
"src/DockWidget.cpp",
"src/DockWidgetTab.cpp",
"src/DockingStateReader.cpp",
"src/ElidingLabel.cpp",
"src/FloatingDockContainer.cpp",
"src/FloatingDragPreview.cpp",
"src/IconProvider.cpp",
"src/ads_globals.cpp",
# "src/linux/FloatingWidgetTitleBar.cpp",
]

View File

@@ -172,6 +172,7 @@ public:
EqualSplitOnInsertion, EqualSplitOnInsertion,
FloatingContainerForceNativeTitleBar, FloatingContainerForceNativeTitleBar,
FloatingContainerForceQWidgetTitleBar, FloatingContainerForceQWidgetTitleBar,
MiddleMouseButtonClosesTab,
DefaultDockAreaButtons, DefaultDockAreaButtons,
DefaultBaseConfig, DefaultBaseConfig,
DefaultOpaqueConfig, DefaultOpaqueConfig,

View File

@@ -34,6 +34,7 @@ public:
DockWidgetFocusable, DockWidgetFocusable,
DockWidgetForceCloseWithArea, DockWidgetForceCloseWithArea,
NoTab, NoTab,
DeleteContentOnClose,
DefaultDockWidgetFeatures, DefaultDockWidgetFeatures,
AllDockWidgetFeatures, AllDockWidgetFeatures,
DockWidgetAlwaysCloseAndDelete, DockWidgetAlwaysCloseAndDelete,

View File

@@ -1,4 +1,4 @@
%Module(name=PyQtAds.QtAds.ads, call_super_init=True, keyword_arguments="Optional", use_limited_api=True) %Module(name=PyQtAds, call_super_init=True, keyword_arguments="Optional", use_limited_api=True)
%Import QtCore/QtCoremod.sip %Import QtCore/QtCoremod.sip
%DefaultSupertype sip.simplewrapper %DefaultSupertype sip.simplewrapper

View File

@@ -61,6 +61,9 @@ else()
add_library(qtadvanceddocking SHARED ${ads_SRCS} ${ads_HEADERS}) add_library(qtadvanceddocking SHARED ${ads_SRCS} ${ads_HEADERS})
target_compile_definitions(qtadvanceddocking PRIVATE ADS_SHARED_EXPORT) target_compile_definitions(qtadvanceddocking PRIVATE ADS_SHARED_EXPORT)
endif() endif()
add_library(ads::qtadvanceddocking ALIAS qtadvanceddocking)
target_link_libraries(qtadvanceddocking PUBLIC Qt${QT_VERSION_MAJOR}::Core target_link_libraries(qtadvanceddocking PUBLIC Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Widgets) Qt${QT_VERSION_MAJOR}::Widgets)
@@ -87,9 +90,9 @@ install(FILES ${ads_HEADERS}
COMPONENT headers COMPONENT headers
) )
install(FILES install(FILES
"${CMAKE_SOURCE_DIR}/LICENSE" "${CMAKE_CURRENT_SOURCE_DIR}/../LICENSE"
"${CMAKE_SOURCE_DIR}/gnu-lgpl-v2.1.md" "${CMAKE_CURRENT_SOURCE_DIR}/../gnu-lgpl-v2.1.md"
DESTINATION license DESTINATION license/ads
COMPONENT license COMPONENT license
) )
install(TARGETS qtadvanceddocking install(TARGETS qtadvanceddocking

View File

@@ -538,7 +538,7 @@ void CDockAreaWidget::onTabCloseRequested(int Index)
{ {
ADS_PRINT("CDockAreaWidget::onTabCloseRequested " << Index); ADS_PRINT("CDockAreaWidget::onTabCloseRequested " << Index);
auto* DockWidget = dockWidget(Index); auto* DockWidget = dockWidget(Index);
if (DockWidget->features().testFlag(CDockWidget::DockWidgetDeleteOnClose)) if (DockWidget->features().testFlag(CDockWidget::DockWidgetDeleteOnClose) || DockWidget->features().testFlag(CDockWidget::CustomCloseHandling))
{ {
DockWidget->closeDockWidgetInternal(); DockWidget->closeDockWidgetInternal();
} }
@@ -956,9 +956,12 @@ QAbstractButton* CDockAreaWidget::titleBarButton(TitleBarButton which) const
void CDockAreaWidget::closeArea() void CDockAreaWidget::closeArea()
{ {
// If there is only one single dock widget and this widget has the // If there is only one single dock widget and this widget has the
// DeleteOnClose feature, then we delete the dock widget now // DeleteOnClose feature or CustomCloseHandling, then we delete the dock widget now;
// in the case of CustomCloseHandling, the CDockWidget class will emit its
// closeRequested signal and not actually delete unless the signal is handled in a way that deletes it
auto OpenDockWidgets = openedDockWidgets(); auto OpenDockWidgets = openedDockWidgets();
if (OpenDockWidgets.count() == 1 && OpenDockWidgets[0]->features().testFlag(CDockWidget::DockWidgetDeleteOnClose)) if (OpenDockWidgets.count() == 1 &&
(OpenDockWidgets[0]->features().testFlag(CDockWidget::DockWidgetDeleteOnClose) || OpenDockWidgets[0]->features().testFlag(CDockWidget::CustomCloseHandling)))
{ {
OpenDockWidgets[0]->closeDockWidgetInternal(); OpenDockWidgets[0]->closeDockWidgetInternal();
} }
@@ -966,7 +969,8 @@ void CDockAreaWidget::closeArea()
{ {
for (auto DockWidget : openedDockWidgets()) for (auto DockWidget : openedDockWidgets())
{ {
if (DockWidget->features().testFlag(CDockWidget::DockWidgetDeleteOnClose) && DockWidget->features().testFlag(CDockWidget::DockWidgetForceCloseWithArea)) if ((DockWidget->features().testFlag(CDockWidget::DockWidgetDeleteOnClose) && DockWidget->features().testFlag(CDockWidget::DockWidgetForceCloseWithArea)) ||
DockWidget->features().testFlag(CDockWidget::CustomCloseHandling))
DockWidget->closeDockWidgetInternal(); DockWidget->closeDockWidgetInternal();
else else
DockWidget->toggleView(false); DockWidget->toggleView(false);

View File

@@ -1625,6 +1625,22 @@ QList<CDockAreaWidget*> CDockContainerWidget::openedDockAreas() const
} }
//============================================================================
QList<CDockWidget*> CDockContainerWidget::openedDockWidgets() const
{
QList<CDockWidget*> DockWidgetList;
for (auto DockArea : d->DockAreas)
{
if (!DockArea->isHidden())
{
DockWidgetList.append(DockArea->openedDockWidgets());
}
}
return DockWidgetList;
}
//============================================================================ //============================================================================
bool CDockContainerWidget::hasOpenDockAreas() const bool CDockContainerWidget::hasOpenDockAreas() const
{ {

View File

@@ -51,6 +51,7 @@ class CFloatingDragPreview;
struct FloatingDragPreviewPrivate; struct FloatingDragPreviewPrivate;
class CDockingStateReader; class CDockingStateReader;
/** /**
* Container that manages a number of dock areas with single dock widgets * Container that manages a number of dock areas with single dock widgets
* or tabyfied dock widgets in each area. * or tabyfied dock widgets in each area.
@@ -216,6 +217,11 @@ public:
*/ */
QList<CDockAreaWidget*> openedDockAreas() const; QList<CDockAreaWidget*> openedDockAreas() const;
/**
* Returns a list for all open dock widgets in all open dock areas
*/
QList<CDockWidget*> openedDockWidgets() const;
/** /**
* This function returns true, if the container has open dock areas. * This function returns true, if the container has open dock areas.
* This functions is a little bit faster than calling openedDockAreas().isEmpty() * This functions is a little bit faster than calling openedDockAreas().isEmpty()

View File

@@ -547,9 +547,16 @@ bool CDockManager::eventFilter(QObject *obj, QEvent *e)
// setWindowFlags(Qt::WindowStaysOnTopHint) will hide the window and thus requires a show call. // setWindowFlags(Qt::WindowStaysOnTopHint) will hide the window and thus requires a show call.
// This then leads to flickering and a nasty endless loop (also buggy behaviour on Ubuntu). // This then leads to flickering and a nasty endless loop (also buggy behaviour on Ubuntu).
// So we just do it ourself. // So we just do it ourself.
internal::xcb_update_prop(true, _window->window()->winId(), if(QGuiApplication::platformName() == QLatin1String("xcb"))
"_NET_WM_STATE", "_NET_WM_STATE_ABOVE", "_NET_WM_STATE_STAYS_ON_TOP"); {
} internal::xcb_update_prop(true, _window->window()->winId(),
"_NET_WM_STATE", "_NET_WM_STATE_ABOVE", "_NET_WM_STATE_STAYS_ON_TOP");
}
else
{
_window->setWindowFlag(Qt::WindowStaysOnTopHint, true);
}
}
} }
else if (e->type() == QEvent::WindowDeactivate) else if (e->type() == QEvent::WindowDeactivate)
{ {
@@ -559,8 +566,16 @@ bool CDockManager::eventFilter(QObject *obj, QEvent *e)
{ {
continue; continue;
} }
internal::xcb_update_prop(false, _window->window()->winId(),
"_NET_WM_STATE", "_NET_WM_STATE_ABOVE", "_NET_WM_STATE_STAYS_ON_TOP"); if(QGuiApplication::platformName() == QLatin1String("xcb"))
{
internal::xcb_update_prop(false, _window->window()->winId(),
"_NET_WM_STATE", "_NET_WM_STATE_ABOVE", "_NET_WM_STATE_STAYS_ON_TOP");
}
else
{
_window->setWindowFlag(Qt::WindowStaysOnTopHint, false);
}
_window->raise(); _window->raise();
} }
} }
@@ -843,10 +858,6 @@ CDockAreaWidget* CDockManager::addDockWidgetTab(DockWidgetArea area,
{ {
return addDockWidget(ads::CenterDockWidgetArea, Dockwidget, AreaWidget); return addDockWidget(ads::CenterDockWidgetArea, Dockwidget, AreaWidget);
} }
else if (!openedDockAreas().isEmpty())
{
return addDockWidget(area, Dockwidget, openedDockAreas().last());
}
else else
{ {
return addDockWidget(area, Dockwidget, nullptr); return addDockWidget(area, Dockwidget, nullptr);

View File

@@ -456,6 +456,14 @@ CDockContainerWidget* CDockWidget::dockContainer() const
} }
//============================================================================
CFloatingDockContainer* CDockWidget::floatingDockContainer() const
{
auto DockContainer = dockContainer();
return DockContainer ? DockContainer->floatingWidget() : nullptr;
}
//============================================================================ //============================================================================
CDockAreaWidget* CDockWidget::dockAreaWidget() const CDockAreaWidget* CDockWidget::dockAreaWidget() const
{ {
@@ -547,6 +555,7 @@ void CDockWidget::toggleView(bool Open)
{ {
Open = true; Open = true;
} }
// If the dock widget state is different, then we really need to toggle // If the dock widget state is different, then we really need to toggle
// the state. If we are in the right state, then we simply make this // the state. If we are in the right state, then we simply make this
// dock widget the current dock widget // dock widget the current dock widget
@@ -556,7 +565,7 @@ void CDockWidget::toggleView(bool Open)
} }
else if (Open && d->DockArea) else if (Open && d->DockArea)
{ {
d->DockArea->setCurrentDockWidget(this); raise();
} }
} }
@@ -670,6 +679,12 @@ bool CDockWidget::event(QEvent *e)
{ {
d->DockArea->markTitleBarMenuOutdated();//update tabs menu d->DockArea->markTitleBarMenuOutdated();//update tabs menu
} }
auto FloatingWidget = floatingDockContainer();
if (FloatingWidget)
{
FloatingWidget->updateWindowTitle();
}
Q_EMIT titleChanged(title); Q_EMIT titleChanged(title);
} }
break; break;

View File

@@ -331,6 +331,12 @@ public:
*/ */
CDockContainerWidget* dockContainer() const; CDockContainerWidget* dockContainer() const;
/**
* This function return the floating DockContainer if is isFloating() is true
* and a nullptr if this dock widget is not floating.
*/
CFloatingDockContainer* floatingDockContainer() const;
/** /**
* Returns the dock area widget this dock widget belongs to or 0 * Returns the dock area widget this dock widget belongs to or 0
* if this dock widget has not been docked yet * if this dock widget has not been docked yet

View File

@@ -716,6 +716,10 @@ bool CDockWidgetTab::event(QEvent *e)
} }
} }
#endif #endif
if (e->type() == QEvent::StyleChange)
{
d->updateIcon();
}
return Super::event(e); return Super::event(e);
} }

View File

@@ -802,29 +802,43 @@ void CFloatingDockContainer::closeEvent(QCloseEvent *event)
ADS_PRINT("CFloatingDockContainer closeEvent"); ADS_PRINT("CFloatingDockContainer closeEvent");
d->setState(DraggingInactive); d->setState(DraggingInactive);
event->ignore(); event->ignore();
if (!isClosable())
if (isClosable())
{ {
auto TopLevelDockWidget = topLevelDockWidget(); return;
if (TopLevelDockWidget && TopLevelDockWidget->features().testFlag(CDockWidget::DockWidgetDeleteOnClose)) }
bool HasOpenDockWidgets = false;
for (auto DockWidget : d->DockContainer->openedDockWidgets())
{
if (DockWidget->features().testFlag(CDockWidget::DockWidgetDeleteOnClose) || DockWidget->features().testFlag(CDockWidget::CustomCloseHandling))
{ {
if (!TopLevelDockWidget->closeDockWidgetInternal()) bool Closed = DockWidget->closeDockWidgetInternal();
if (!Closed)
{ {
return; HasOpenDockWidgets = true;
} }
} }
else
// In Qt version after 5.9.2 there seems to be a bug that causes the {
// QWidget::event() function to not receive any NonClientArea mouse DockWidget->toggleView(false);
// events anymore after a close/show cycle. The bug is reported here: }
// https://bugreports.qt.io/browse/QTBUG-73295
// The following code is a workaround for Qt versions > 5.9.2 that seems
// to work
// Starting from Qt version 5.12.2 this seems to work again. But
// now the QEvent::NonClientAreaMouseButtonPress function returns always
// Qt::RightButton even if the left button was pressed
this->hide();
} }
if (HasOpenDockWidgets)
{
return;
}
// In Qt version after 5.9.2 there seems to be a bug that causes the
// QWidget::event() function to not receive any NonClientArea mouse
// events anymore after a close/show cycle. The bug is reported here:
// https://bugreports.qt.io/browse/QTBUG-73295
// The following code is a workaround for Qt versions > 5.9.2 that seems
// to work
// Starting from Qt version 5.12.2 this seems to work again. But
// now the QEvent::NonClientAreaMouseButtonPress function returns always
// Qt::RightButton even if the left button was pressed
this->hide();
} }
//============================================================================ //============================================================================
@@ -1239,12 +1253,12 @@ void CFloatingDockContainer::resizeEvent(QResizeEvent *event)
Super::resizeEvent(event); Super::resizeEvent(event);
} }
static bool s_mousePressed = false;
//============================================================================ //============================================================================
void CFloatingDockContainer::moveEvent(QMoveEvent *event) void CFloatingDockContainer::moveEvent(QMoveEvent *event)
{ {
Super::moveEvent(event); Super::moveEvent(event);
if (!d->IsResizing && event->spontaneous()) if (!d->IsResizing && event->spontaneous() && s_mousePressed)
{ {
d->DraggingState = DraggingFloatingWidget; d->DraggingState = DraggingFloatingWidget;
d->updateDropOverlays(QCursor::pos()); d->updateDropOverlays(QCursor::pos());
@@ -1252,6 +1266,23 @@ void CFloatingDockContainer::moveEvent(QMoveEvent *event)
d->IsResizing = false; d->IsResizing = false;
} }
//============================================================================
bool CFloatingDockContainer::event(QEvent *e)
{
bool result = Super::event(e);
switch (e->type())
{
case QEvent::WindowActivate:
s_mousePressed = false;
break;
case QEvent::WindowDeactivate:
s_mousePressed = true;
break;
default:
break;
}
return result;
}
//============================================================================ //============================================================================
bool CFloatingDockContainer::hasNativeTitleBar() bool CFloatingDockContainer::hasNativeTitleBar()

View File

@@ -188,6 +188,7 @@ protected: // reimplements QWidget
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
virtual void moveEvent(QMoveEvent *event) override; virtual void moveEvent(QMoveEvent *event) override;
virtual void resizeEvent(QResizeEvent *event) override; virtual void resizeEvent(QResizeEvent *event) override;
virtual bool event(QEvent *e) override;
#endif #endif
#ifdef Q_OS_WIN #ifdef Q_OS_WIN