margins

Qt remove margins

懵懂的女人 提交于 2019-12-07 06:22:35
问题 I am currently using a QMainWindow widget and I would like to remove margins around the widget inside. I success to remove margins for window borders but not for the widgets inside my window. Here is my code, for example : this->mainWidget = new QWidget(this); this->mainLayout = new QHBoxLayout; QLabel *foo = new QLabel("foo", this); QLabel *bar = new QLabel("bar", this); mainLayout->setContentsMargins(0, 0, 0, 0); // Remove margins for window borders this->setWindowFlags(Qt:

vb.net 2010 PrintDocument Margins not working even if I set the margins

半腔热情 提交于 2019-12-06 11:32:22
I am reading from a text file and then printing the string using printdocument via vb.net 2010. Here is my code : Public Class myPrinter Friend TextToBePrinted As String Public Sub prt(ByVal text As String) Dim psize As New System.Drawing.Printing.PaperSize("Custom Paper Size", 850, 550) Dim newMargins As New System.Drawing.Printing.Margins(0, 0, 0, 0) TextToBePrinted = text Dim prn As New Printing.PrintDocument Using (prn) prn.PrinterSettings.PrinterName = frmStockOut.printer prn.PrinterSettings.Copies = frmStockOut.copies prn.PrinterSettings.DefaultPageSettings.PaperSize = psize prn

R: calculating margins or row & col sums for a data frame

痴心易碎 提交于 2019-12-06 08:57:34
I have a data frame that looks like this: Flag1 Flag2 Type1 Type2 Type3 1 A FIRST 2 0 0 2 A SECOND 1 9 0 3 A THIRD 3 7 0 4 A FOURTH 9 18 0 5 A FIFTH 1 22 0 6 A SIXTH 1 13 0 7 B FIRST 0 0 0 8 B SECOND 3 9 0 9 B THIRD 5 85 0 10 B FOURTH 4 96 0 11 B FIFTH 3 40 0 12 B SIXTH 0 17 0 I need to sum in such a way that my data frame finally looks like this Flag1 Flag2 Type1 Type2 Type3 Sum 1 A FIRST 2 0 0 2 2 A SECOND 1 9 0 10 3 A THIRD 3 7 0 10 4 A FOURTH 9 18 0 27 5 A FIFTH 1 22 0 23 6 A SIXTH 1 13 0 14 7 B FIRST 0 0 0 0 8 B SECOND 3 9 0 12 9 B THIRD 5 85 0 90 10 B FOURTH 4 96 0 100 11 B FIFTH 3 40 0

Jquery Fancybox 2 adds a margin-right?

喜你入骨 提交于 2019-12-06 00:51:32
When I use the Fancybox 2 jquery plugin, a margin-right of 23px gets added (width of scrollbar). Here's the website (click on the Site Map button): http://kevinlouisdesign.com/projects/Canu/web/ What I don't like is that it makes the content jump to the left when the fancybox shows up. I'd like to get rid of this margin-right style. It's a CSS fix. On the .fancybox-lock style, get rid of the overflow-y: scroll , so the style that looks like this: .fancybox-lock .fancybox-overlay { overflow: auto; overflow-y: scroll; } Should instead look like this: .fancybox-lock .fancybox-overlay { overflow:

Qt remove margins

北慕城南 提交于 2019-12-05 11:25:55
I am currently using a QMainWindow widget and I would like to remove margins around the widget inside. I success to remove margins for window borders but not for the widgets inside my window. Here is my code, for example : this->mainWidget = new QWidget(this); this->mainLayout = new QHBoxLayout; QLabel *foo = new QLabel("foo", this); QLabel *bar = new QLabel("bar", this); mainLayout->setContentsMargins(0, 0, 0, 0); // Remove margins for window borders this->setWindowFlags(Qt::FramelessWindowHint); foo->setStyleSheet("background-color: green"); bar->setStyleSheet("background-color: red"); foo-

Changing margin for emacs text-mode

半城伤御伤魂 提交于 2019-12-05 02:01:22
问题 The only way I found to change margins in emacs to my liking without things acting funny is this: (add-hook 'window-configuration-change-hook (lambda () (set-window-margins (car (get-buffer-window-list (current-buffer) nil t)) 24 24))) I would like for this setting to be invoked only in text-mode and change back when I change to other modes. Somewhat naively I tried this: (add-hook 'text-mode-hook (lambda () (set-window-margins (car (get-buffer-window-list (current-buffer) nil t)) 24 24)))

Item with margin-top has margin outside of containing box

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 00:25:37
I have something to this effect: #div { background: green; width: 200px; height: 100px; } h1 { margin-top: 100px; } (And obviously there is some HTML to go with it.) Now when viewed in the browser the h1 shows at the very top of the #div and the 100px margin goes on top of the #div . Can anyone suggest a reason? (The code is a little too complicated to insert the relevant parts so if no-one can give me an answer then I will post it and maybe someone will spot an error or something.) Try to add padding instead. I've seen this kind of problem before. If the padding does the the same thing then

What does “Constrain to margins” mean in Interface Builder in Xcode 6.0.1

耗尽温柔 提交于 2019-12-04 17:48:23
问题 I understand the purpose of "Spacing to the nearest neighbor" (in Xcode 6, more especially in Interface Builder) but what is the point of "Constrain to margins"? Is there a link between "Spacing to the nearest neighbor" an edge of a particular control button, and the fact of at the same time checking the checkbox named "Constrain to margins"? What is the role of this feature in Autolayout? Please find a screenshot with the checkbox and the label that I am talking about surrounded in red below

Extra padding or margin coming from where?

坚强是说给别人听的谎言 提交于 2019-12-04 16:51:12
October Landing Page I'm having a couple issues on a page I'm developing. In the page above you'll see three boxes toward the bottom of the page - two are the same format and the third has it's own problems. Box 1 & 2 (the ones without borders) PROBLEM: somehow the list items have some extra left padding (apparently) that is not specified in the style sheet - at least not intentionally. Are they inheriting padding from elsewhere? Both boxes seem to be exhibiting this problem. Box 3 (the one with the donation buttons) PROBLEM: the top row of buttons seem to be inheriting some extra padding or

How to set layout_margin programmatically? [duplicate]

白昼怎懂夜的黑 提交于 2019-12-04 15:35:24
问题 This question already has answers here : Set margins in a LinearLayout programmatically (10 answers) Closed 5 years ago . I want to know how to set layout_marginLeft, layout_marginTop, layout_marginBottom programmatically using screen height and width. Please help me. Thanks Monali 回答1: Here is an example (adapted from this answer): LinearLayout layout = new LinearLayout(this); layout.setOrientation(LinearLayout.VERTICAL); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(